﻿using System;
using MaLu.Common;
using MaLu.Data;
using System.Data;
using Malu.Entity;

namespace MaluJg.web.FarmerShare
{
    public partial class FSDetail : FSPage
    {
        protected int RecordID
        {
            get
            {
                int gd = 0;
                if (Request["ID"] != null)
                {
                    int.TryParse(Request["ID"] ?? "0", out gd);

                }
                else
                {
                    if (ViewState["ID"] != null)
                        gd = (int)ViewState["ID"];


                }
                if (ViewState["ID"] == null)
                    ViewState["ID"] = gd;
                return gd;
            }
            set
            {
                ViewState["ID"] = value;
            }

        }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.Title = "农民股金详细清单";
            this.UseTabber = true;
            if (!IsPostBack)
            {
               BindData();
            }
        }
        private void BindData()
        {
            FaShare fs = ProviderManager.Factory.FaShare.Get(Provider, RecordID);
            if (fs != null)
            {

                lbAdd.Text = fs.place;
                lbAmount.Text = fs.amount.ToString();
                lbFax.Text = fs.fax.ToString();
                lbHongli.Text = fs.honglipercent.ToString();
                lbJinE.Text = fs.jine.ToString();
                lbJinePer.Text = fs.jinepergu.ToString();
                lbName.Text = fs.familyname;
                lbRealGet.Text = fs.realget.ToString();
                lbRemark.Text = fs.remark;
                lbVillage.Text = fs.village;
                lbYear.Text = fs.year.ToString();
                lbYingDe.Text = fs.yingde.ToString();
            }
        }
        protected void lbtnDelete_Click(object sender, EventArgs e)
        {
            ProviderManager.Factory.FaShare.Delete(Provider, RecordID);
            ClientScript.RegisterStartupScript(this.GetType(), "Delete", "<script>parent.location.href = parent.location.href</script>");
        }

    }
}
